/*
 * @Author: Li Zengkun
 * @Date: 2022-09-05 10:16:52
 * @LastEditors: Li Zengkun
 * @LastEditTime: 2022-09-09 09:29:43
 * @Description: 
 */
import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'
import Layout from '@/components/Layout.vue'

const router = createRouter({
    history: createWebHistory(
        import.meta.env.BASE_URL),
    routes: [{
        path: '/',
        name: 'home',
        component: Layout,
        children: [{
                path: '/',
                name: 'homeView',
                meta: { key: '0' },
                component: () =>
                    import ('@/views/HomeView.vue')

            },
            {
                path: '/vue2-principle',
                name: 'vue2-principle',
                meta: { key: '1_1_1' },
                component: () =>
                    import ('@/views/BottomPrinciple/Vue2Principle.vue')
            },
            {
                path: '/vue3-principle',
                name: 'vue3-principle',
                meta: { key: '1_1_2' },
                component: () =>
                    import ('@/views/BottomPrinciple/Vue3Principle.vue')
            },
            {
                path: '/virtual_dom',
                name: 'virtual_dom',
                meta: { key: '1_2' },
                component: () =>
                    import ('@/views/BottomPrinciple/VirtualDOM.vue')
            },
            {
                path: '/wang-editor',
                name: 'wang-editor',
                meta: { key: '2' },
                component: () =>
                    import ('@/views/WangEditor.vue')
            },
            {
                path: '/exercises/data-transfer',
                name: 'data-transfer',
                meta: { key: '3_1' },
                component: () =>
                    import ('@/views/VueExercises/1-DataTransfer.vue')
            },
            {
                path: '/exercises/props-test',
                name: 'props-test',
                meta: { key: '3_2' },
                component: () =>
                    import ('@/views/VueExercises/2-PropsTest.vue')
            },
            {
                path: '/exercises/star-slider',
                name: 'star-slider',
                meta: { key: '3_3' },
                component: () =>
                    import ('@/views/VueExercises/3-StarSlider.vue')
            },
            {
                path: '/exercises/upload-avatar',
                name: 'upload-avatar',
                meta: { key: '3_4' },
                component: () =>
                    import ('@/views/VueExercises/4-UploadAvatar.vue')
            },
        ],

    }, ]
})

export default router